<template>
  <div id="app">
    <transition :name="viewTransition">
      <keep-alive :exclude="cache">
        <router-view class="viewContent"></router-view>
      </keep-alive>
    </transition>
     <toast v-model="isToast.isShow" :time="1000" type="warn">操作失败</toast>
  </div>
</template>

<script>
import { Tabbar, TabbarItem,Toast } from "vux";
import store from './store'
import { mapState } from "vuex";
export default {
  components:{
    Toast
  },
  data() {
    return {
      show:true,
      entryUrl: document.location.href
    };
  },
  name: "App",
  created() {
    let me=this;
    window.addEventListener(
      "popstate",
      function(e) {
        
       me.navigation_android_back();
      },
      false
    );
  },
  computed: {
    ...mapState({
      direction: state => state.switchPage.direction,
      cache: state => state.cache.list,
      isToast:state => state.toast
    }),
    viewTransition() {
      if (!this.direction) return "";
      return "vux-pop-" + (this.direction === "forward" ? "in" : "out");
    }
  }
};
</script>

<style lang="scss">
</style>
